package com.geeguo.ebuilder.core.common.model.query;

import java.io.Serializable;

public class Pagination implements Serializable {

    private int               pageNo           = 1;
    private int               pageSize         = 10;

    public final int getPageNo() {
        return pageNo;
    }

    public final void setPageNo(int pageNo) {
        if (pageNo < 1) {
            pageNo = 1;
        }
        this.pageNo = pageNo;
    }

    public final int getPageSize() {
        return pageSize;
    }

    public final void setPageSize(int pageSize) {
    	if (pageSize < 1) {
    		pageSize = 1;
        }
        this.pageSize = pageSize;
    }

    public final int getFirstResult() {
        return (getPageNo() - 1) * getPageSize();
    }
}